package br.com.caelum.vraptor.components;

import java.io.Serializable;

import javax.enterprise.context.SessionScoped;
import javax.inject.Named;

import br.com.caelum.vraptor.entidades.Administrador;

@SessionScoped
@Named("admsessioned")
public class AdmSessioned implements Serializable{
       
        private Administrador adm;
       
        public void login(Administrador adm){
                this.adm = adm;
        }
       
        public void logout(){
                this.adm= null;
        }
       
        public String getNome(){
                return adm.getNome();
        }
       
        public String getLogin(){
                return adm.getMatricula();
        }
       
        public boolean isLogado(){
                return adm != null;
        }

}
